package com.sh.data.engine.domain.common.model.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import gudusoft.gsqlparser.dlineage.dataflow.model.Process;
import gudusoft.gsqlparser.dlineage.metadata.Sqlflow;

import java.util.Arrays;

@JSONType(orders = {"dbobjs", "relationships", "errors", "orientation", "processes"})
public class DataFlow {
    @JSONField(ordinal = 1)
    private Sqlflow dbobjs;

    @JSONField(ordinal = 2)
    private Relationship[] relationships;

    @JSONField(ordinal = 3)
    private Error[] errors;

    @JSONField(ordinal = 4)
    private String orientation;

    @JSONField(ordinal = 5)
    private Process[] processes;

    public void setDbobjs(Sqlflow dbobjs) {
        this.dbobjs = dbobjs;
    }

    public void setRelationships(Relationship[] relationships) {
        this.relationships = relationships;
    }

    public void setErrors(Error[] errors) {
        this.errors = errors;
    }

    public void setOrientation(String orientation) {
        this.orientation = orientation;
    }

    public void setProcesses(Process[] processes) {
        this.processes = processes;
    }

    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof DataFlow))
            return false;
        DataFlow other = (DataFlow) o;
        if (!other.canEqual(this))
            return false;
        Object this$dbobjs = getDbobjs(), other$dbobjs = other.getDbobjs();
        if ((this$dbobjs == null) ? (other$dbobjs != null) : !this$dbobjs.equals(other$dbobjs))
            return false;
        if (!Arrays.deepEquals((Object[]) getRelationships(), (Object[]) other.getRelationships()))
            return false;
        if (!Arrays.deepEquals((Object[]) getErrors(), (Object[]) other.getErrors()))
            return false;
        Object this$orientation = getOrientation(), other$orientation = other.getOrientation();
        return ((this$orientation == null) ? (other$orientation != null) : !this$orientation.equals(other$orientation)) ? false : (!!Arrays.deepEquals((Object[]) getProcesses(), (Object[]) other.getProcesses()));
    }

    protected boolean canEqual(Object other) {
        return other instanceof DataFlow;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $dbobjs = getDbobjs();
        result = result * 59 + (($dbobjs == null) ? 43 : $dbobjs.hashCode());
        result = result * 59 + Arrays.deepHashCode((Object[]) getRelationships());
        result = result * 59 + Arrays.deepHashCode((Object[]) getErrors());
        Object $orientation = getOrientation();
        result = result * 59 + (($orientation == null) ? 43 : $orientation.hashCode());
        return result * 59 + Arrays.deepHashCode((Object[]) getProcesses());
    }

    public String toString() {
        return "DataFlow(dbobjs=" + getDbobjs() + ", relationships=" + Arrays.deepToString((Object[]) getRelationships()) + ", errors=" + Arrays.deepToString((Object[]) getErrors()) + ", orientation=" + getOrientation() + ", processes=" + Arrays.deepToString((Object[]) getProcesses()) + ")";
    }

    public Sqlflow getDbobjs() {
        return this.dbobjs;
    }

    public Relationship[] getRelationships() {
        return this.relationships;
    }

    public Error[] getErrors() {
        return this.errors;
    }

    public String getOrientation() {
        return this.orientation;
    }

    public Process[] getProcesses() {
        return this.processes;
    }
}